1. Field of Invention
The present invention relates to a method of image coding and decoding, and more particularly, to a Block Truncation Coding (BTC) method and apparatus thereof.
2. Description of Related Art
The amount of data in the digital video image transmission is usually very large, so image compression or source coding is one of the most important steps in the digital video image processing. The common image compression or source coding methods include the JPEG coding method for static images, the Motion Picture Experts Group (MPEG) coding method for motion picture compression, etc. However, when performing the digital image coding, the compression methods require huge memory size and high-speed and complicated digital processing capability; thus, it is usually impractical to be used in some integrated circuits that can perform only simple operation. Here, the BTC (Block Truncation Coding) is an appropriate method.
The conventional BTC method comprises the following steps:    (a) Divide the whole image into blocks that are mutually non-overlapped and each block comprises M×N pixels (horizontal M points and vertical N points);    (b) Calculate the block mean X of the pixels in each block;    (c) According to the block mean X, classify the pixels in the block into a high intensity group whose pixel values are larger than or equal to the block mean X, and a low intensity group whose pixel values are less than the block mean X;    (d) Assign a corresponding bit based on which group each of the pixels belongs to, for example, the bit 1 represents that the pixel belongs to the high intensity group, and the bit 0 represents that the pixel belongs to the low intensity group, the number of the corresponding bits of all the pixels is M×N, and the corresponding bits of all the pixels constitutes a bitmap;    (e) Calculate the mean value of the pixels of the high intensity group A called high mean and the mean value of the pixels of the low intensity group B called low mean;    (f) Transmit the high mean A, the low mean B and the bitmap for decoding; and    (g) Repeat steps (a) to (f) for the coming blocks of the source image;
The Block Truncation Decoding method comprises:    (a) Receive the high mean A, the low mean B and bitmap of a particular block in the source image;    (b) If the corresponding bit of the pixel in the bitmap is 1, use the high mean A as the decoding value, otherwise, use the low mean B as the decoding value; and    (c) Repeat the same operation on the other blocks in the source image.
In the following, a specific embodiment is used for description. Referring to the table below, it is assumed that the input image is divided into the blocks formed by 4×2 pixels, and one of the blocks is as follows:
TABLE 1101989946102504848
In the following, the above block is coded as an example. The block mean X in the block is 74. The pixels that are larger than or equal to 74 belong to the high intensity group, and the pixels that are less than 74 belong to the low intensity group, and the bitmap is:
11101000this can be coded as C8H (hexadecimal). The mean value of the high intensity group (high mean) A is 100, and the mean value of the low intensity group (low mean) B is 48. The high mean 100, the low mean 48 and the bitmap (C8H) are transmitted for decoding.
During decoding, the decoder receives A: the high mean 100; B: the low mean 48 and the bitmap (C8H), and the block after decoding is:
10010010048100484848
When the conventional BTC method is applied to a moving picture sequence, sometimes a pixel at the same position in a frame may be affected by the noise so that the pixel is classified into the high intensity group in a certain frame, and classified into the low intensity group in another frame. This unstable assignment also results in significant change in the high and low means. During decoding, the high mean and low mean may be respectively used as the decoding value. If the difference between the two mean values is big, the pixel may have flickers at different frames, which seriously influences the quality of the frame.
Moreover, in the conventional BTC method, because only the two high and low mean values are used to decode the block, the quality of the decoded image of the highly changing block is not sufficient. The present invention aims to minimize the above two disadvantages with simple modification on the block truncation coding.